<script setup>
import { computed } from 'vue';
import Position from '@/components/Position.vue'
import FooterBorder from '@/components/FooterBorder.vue'
import { useRouter } from 'vue-router'
import { useStore } from 'vuex'

const router = useRouter()
const store = useStore()

const hallList = computed(() => store.getters.getHallList)

const clickCard = (id) => {
    router.push(`/hall/${id}`)
}

</script>

<template>
    <div class="content">
        <div class="top-image"></div>
        <Position>
            <template #default>
                珍宝馆
            </template>
        </Position>
        <div class="container">
            <div class="bt">
                <a href="#">珍宝馆</a>
                <span></span>
            </div>

            <div class="card-box">
                <div @click="clickCard(item.id)" class="card" v-for="item in hallList">
                    <img style="border-radius: 10px;" :src="item.imageUrl" width="210px" height="210px">
                    <h3>{{ item.name }}</h3>
                </div>
            </div>
        </div>
        <FooterBorder></FooterBorder>
    </div>
</template>

<style scoped>
h3 {
    color: #D69A3d;
    font-size: 16px;
    font-weight: normal;
    margin: 0 0;
}

.card-box {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: space-evenly;
}

.card {
    width: 246px;
    height: 278px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    cursor: pointer;
    caret-color: transparent;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

p {
    line-height: 22px;
    color: #555555;
    font-size: 18px;
}

.line {
    height: 35px;
    border-top: 1px solid #888576;
    margin-top: 35px;
}

.top-image {
    height: 257px;
    background-image: url('@/assets/hall.jpg');
    /* background-size: cover; */
    background-repeat: no-repeat;
    background-position: center center;
}

.position {
    height: 48px;
    background-image: url('@/assets/postionbg.gif');
    /* background-size: cover; */
    /* background-repeat: no-repeat; */
    background-position: center center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.position-content {
    display: flex;
    width: 960px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-left: 20px;
    background-image: url('@/assets/postionl.gif');
    background-repeat: no-repeat;
    background-position: center left;
}

.position-content .left {
    display: flex;
    align-items: center;
}

.position-content .right {
    display: flex;
    align-items: center;
}

.bread {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 12px;
    color: #E68340;
}

.bread>span {
    padding-right: 10px;
    background-image: url('@/assets/postij.gif');
    background-repeat: no-repeat;
    background-position: center right;
}

.left>span {
    margin-left: 5px;
    color: #FFE179;
    font-size: 12px;
}

.container {
    width: 960px;
    margin: 0 auto;
    padding: 60px 0;
}

.bt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
    /* border: 2px solid #941200; */
    border-top: 2px solid #941200;
    border-bottom: 2px solid #941200;
    margin-bottom: 30px;
}

.bt>span {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    background-image: url('@/assets/more4.gif');
    background-position: center center;
    background-repeat: no-repeat;
}

.bt>a {
    text-decoration: none;
    color: #941200;
    /* background-color: #941200; */
    font-size: 18px;
    width: 76px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
</style>